/* 工具分析仪表板样式 */

.tool-analytics-dashboard {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 24px;
  min-height: 600px;
}

/* 仪表板标题 */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9ecef;
}

.header-info {
  flex: 1;
}

.dashboard-title {
  margin: 0 0 4px 0;
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

.last-updated {
  font-size: 12px;
  color: #6c757d;
}

.export-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover:not(:disabled) {
  background: #0056b3;
  transform: translateY(-1px);
}

.export-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 核心指标网格 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.metric-card:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.metric-header {
  margin-bottom: 16px;
}

.metric-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 总体统计卡片 */
.metric-card.overview .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

.metric-card.overview .stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 14px;
  color: #6c757d;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}

.stat-value.available {
  color: #28a745;
}

.stat-value.unavailable {
  color: #dc3545;
}

.stat-value.rate {
  color: #007bff;
}

/* 健康度评分卡片 */
.metric-card.health {
  text-align: center;
}

.health-score {
  margin-bottom: 16px;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  position: relative;
}

.score-inner {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-number {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

.score-grade {
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
}

.health-description {
  font-size: 14px;
  color: #6c757d;
  line-height: 1.4;
  margin-bottom: 16px;
}

.health-breakdown {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.breakdown-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.breakdown-label {
  display: block;
  font-size: 11px;
  color: #6c757d;
  margin-bottom: 4px;
}

.breakdown-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #007bff;
}

/* 分类分析卡片 */
.availability-levels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-label {
  font-size: 13px;
  color: #495057;
}

.level-count {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

.level-bar {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.level-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.level-item.high .level-fill {
  background: #28a745;
}

.level-item.medium .level-fill {
  background: #ffc107;
}

.level-item.low .level-fill {
  background: #dc3545;
}

/* 详细分析区域 */
.analysis-section {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.analysis-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.tab-btn.active {
  background: white;
  color: #007bff;
  border-bottom: 2px solid #007bff;
}

.analysis-content {
  padding: 24px;
  min-height: 400px;
}

/* 概览分析 */
.overview-analysis h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #2c3e50;
}

.category-ranking {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 30px 30px 1fr 80px 100px;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ranking-item:hover {
  background: #e9ecef;
}

.rank {
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
}

.category-icon {
  font-size: 16px;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
}

.category-stats {
  font-size: 12px;
  color: #6c757d;
  text-align: right;
}

.category-bar {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

/* 分布分析 */
.distribution-analysis h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #2c3e50;
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.bar-icon {
  font-size: 16px;
}

.bar-label {
  font-size: 14px;
  color: #2c3e50;
  flex: 1;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
}

.bar-visual {
  flex: 1;
  height: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}

.bar-available {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-unavailable {
  height: 100%;
  background: #e9ecef;
  transition: width 0.3s ease;
}

/* 热力图 */
.heatmap-analysis h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #2c3e50;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cell-icon {
  font-size: 16px;
  margin-bottom: 4px;
}

.cell-value {
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.legend-label {
  font-size: 12px;
  color: #6c757d;
}

.legend-gradient {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-min,
.legend-max {
  font-size: 11px;
  color: #6c757d;
}

.gradient-bar {
  width: 100px;
  height: 8px;
  background: linear-gradient(90deg, #e9ecef, #007bff);
  border-radius: 4px;
}

/* 配置建议 */
.recommendations-analysis h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #2c3e50;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recommendation-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.recommendation-item:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.rec-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.rec-priority {
  margin-top: 2px;
}

.priority-badge {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 20px;
}

.rec-info {
  flex: 1;
}

.rec-title {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

.rec-description {
  margin: 0;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.4;
}

.rec-actions {
  display: flex;
  align-items: center;
}

.rec-action-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rec-action-btn:hover {
  background: #0056b3;
}

.no-recommendations {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.no-rec-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-rec-text h5 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #28a745;
}

.no-rec-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tool-analytics-dashboard {
    padding: 16px;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .analysis-tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    text-align: center;
  }
  
  .ranking-item {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }
  
  .chart-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .bar-info {
    min-width: auto;
    justify-content: space-between;
  }
  
  .heatmap-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  
  .recommendation-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .rec-header {
    align-items: center;
  }
  
  .rec-actions {
    justify-content: center;
  }
}
